# codig:UTF-8
# pyinstaller -F -i my.ico GenUUid.py
import os
import time
import uuid
import datetime
os.system("title GenUUID ---> Powered by Luke.Qin")
os.system("color 0a")
os.system("@echo off")
os.system("cls")
print("初始化。。。\n")
TorF = input("循环生成请输入Q，否则按默认生成单次uuid：")
if TorF == "Q" or TorF == "q":
    allNumstr = input("\n请输入生成次数：")
    allNum = int(allNumstr)
    for x in range(1, allNum+1):
        tmptime = datetime.datetime.now()
        tmpstr = uuid.uuid4()
        if x == 1:
            os.system("echo " + str(x) + "-" + str(tmptime) +
                      "'s Uid:" + str(tmpstr) + ">NewUUIDCircle.txt")
        else:
            os.system("echo " + str(x) + "-" + str(tmptime) +
                      "'s Uid:" + str(tmpstr) + ">>NewUUIDCircle.txt")
    time.sleep(1)
    print("\n生成完毕，请参见同目录下的txt文件：\n")
    os.system("pause")
    exit()
else:
    tmptime = datetime.datetime.now()
    tmpstr = uuid.uuid4()
    os.system("echo " + str(tmptime) + "'s Uid:" +
              str(tmpstr) + ">NewUUID.txt")
    '''
	fl = input("\n是否覆盖？T/F：")
	if fl == "T" or fl == "t":
		os.system("echo " + str(tmptime) + "'s Uid:" + str(tmpstr) + ">NewUUID.txt")
	else:
		os.system("echo " + str(tmptime) + "'s Uid:" + str(tmpstr) + ">>NewUUID.txt")
	'''
    time.sleep(1)
    print("\n生成完毕，请参见同目录下的txt文件：\n")
    os.system("pause")
    exit()
